<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" type="image/ico" th:href="@{/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/index.css}">
    <title>字典列表</title>
</head>
<body class="layui-tab-content">
<div class="layui-card layui-card-body">
<div class="layui-form toolbar" id="queryTools">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" >字典名称/类型</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="queryName" placeholder="请输出名称">
            </div>
        </div>
        <button class="layui-btn" id="renderTable">查询</button>
        <button class="layui-btn" id="resetSearch">重置</button>
        <button class="layui-btn" id="addNew">添加</button>
    </div>
</div>
<table class="layui-hide" id="dictTable" lay-filter="dictFilter"></table>
</div>
<!--新增修改字典项界面-->
<form class="layui-form" id="dictForm" lay-filter="dictForm" style="display:none;padding-top:10px">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">字典类型</label>
        <div class="layui-input-inline">
            <input type="text" name="code" lay-verify="required" autocomplete="off" placeholder="请输入类别"
                   class="layui-input layui-form-danger">
        </div>
        <label class="layui-form-label">字典名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入类别名称"
                   class="layui-input layui-form-danger">
        </div>
        <label class="layui-form-label">提示</label>
        <div class="layui-input-inline">
            <input type="text" name="tips" autocomplete="off" placeholder="请输入提示信息"
                   class="layui-input layui-form-danger">
        </div>
        <button class="layui-btn" id="addItem">增加字典项</button>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>字典项</legend>
    </fieldset>
    <div class="layui-form-item layui-hide">
        <button id="saveDict" class="layui-btn" lay-submit lay-filter="editDict">保存</button>
    </div>
</form>
<div class="layui-form-item add-item" name="itemHtml" style="display:none;">
    <label class="layui-form-label">编码</label>
    <div class="layui-input-inline">
        <input type="text" name="codeItem" lay-verify="required" autocomplete="off" placeholder="请输入编码"
               class="layui-input layui-form-danger">
    </div>
    <label class="layui-form-label">名称</label>
    <div class="layui-input-inline">
        <input type="text" name="nameItem" lay-verify="required" autocomplete="off" placeholder="请输入名称"
               class="layui-input layui-form-danger">
    </div>
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
        <input type="text" name="numItem" lay-verify="required" autocomplete="off" placeholder="请输入排序"
               class="layui-input layui-form-danger">
    </div>
    <button class="layui-btn layui-btn-primary layui-btn-sm" name="delItem"><i class="layui-icon"></i></button>
</div>
<!--查看字典界面-->
<form class="layui-form" id="dictView" lay-filter="dictView" style="display:none;padding-top:10px">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">类别</label>
        <div class="layui-input-inline">
            <input type="text" name="code" lay-verify="required" autocomplete="off" class="layui-input layui-form-danger">
        </div>
        <label class="layui-form-label">类别名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="required" autocomplete="off" class="layui-input layui-form-danger">
        </div>
        <label class="layui-form-label">提示</label>
        <div class="layui-input-inline">
            <input type="text" name="tips" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>字典项</legend>
    </fieldset>
</form>
<!--列操作-->
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<!--按钮操作-->
<script type="text/html" id="tableToolbar">
    <div class="layui-btn-container">

    </div>
</script>

<script type="text/javascript" th:src="@{/js/plugins/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/sys/sysDict/list.js}"></script>
</body>
</html>